Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## rdlc.sw.java
Class OutputFile

    java.lang.Object
      rdlc.main.OutputFile
          rdlc.sw.java.OutputFile

     class OutputFile

extends OutputFile

Contains a number of very simply print functions designed to aid in generating java output files which have comments and are actually readable.

Version:
  $Revision: 1.29 $
Author:
  Greg Gibeling

Field Summary
`static java.lang.String[]` | `OP_INFIX` Infix operator strings.
`static java.lang.String[]` | `TYPE_NAMES` Mapping from simple type bitwidths to names.

Fields inherited from class rdlc.main.OutputFile
`author, description, fileName, out`

Constructor Summary
`OutputFile(java.io.File outputPath, java.lang.String _fileName, java.lang.String _author, java.lang.String _description, java.util.List<java.io.File> manifest, Log errorLog)`

Method Summary
`protected static java.util.List<java.io.File>` | `emit(java.io.File outputPackagePath, Declaration _declaration, java.lang.String _author, java.lang.String _description, boolean shell, boolean outputAll, Log errorLog)` Emit the given declaration and all of the declarations that it requires to the given path.
`protected static java.util.List<java.io.File>` | `emit(java.io.File outputPackagePath, Declaration _declaration, java.lang.String _author, java.lang.String _description, boolean shell, CatalogSet<Declaration> outputSet, boolean recurse, boolean first, Log errorLog)` Emit the given declaration.
`protected Type.Default` | `getRealDefault(Type type)` Get the real default value for the given type.
`protected java.lang.String` | `listString(Expression_Operation expOp, int start)` List the arguments of the given operation.
`protected void` | `printBlankComment(int indent)` Print a blank javadoc line at the given tabstop.
`protected void` | `printClassEnd()` Print the end of an class declaration.
`protected void` | `printClassMethod(ClassInstance classInstance, ClassMethod classMethod)` Print the the given method in the given class instance.
`protected void` | `printClassStart(Class _class)` Print the javadoc comment header, inheritance list and type arguments among other things.
`protected void` | `printClassVariable(Variable variable)` Print a class level declaration for the given variable complete with initializer and javadoc comment.
`protected void` | `printComment(int indent, java.lang.String comment)` Print a comment at the given tabstop.
`protected void` | `printCommentEnd(int indent)` Print a javadoc end line at the given tabstop.
`protected void` | `printCommentLine(int indent, java.lang.String comment)` Print a single line comment at the given tabstop.
`protected void` | `printCommentStart(int indent, boolean javadoc)` Print a javadoc start line at the given tabstop.
`protected void` | `printCopyright()` Print the copyright notice.
`protected void` | `printHeader()` Print a header for the file, including CVS changelog and tags.
`protected void` | `printLabel(int indent, java.lang.String label)` Print a section label in a comment at the given tabstop.
`protected void` | `printLabeledComment(int indent, java.lang.String label, java.lang.String comment)` Print a labeled comment at the given tabstop.
`protected void` | `printLibraryClass(LibraryClass xclass)` Output a library class by simple copying the contents of its associated file to the proper output location.
`protected void` | `printLibraryFile(LibraryFile file)` Output a library file by simple copying the contents of its associated file to the proper output location.
`protected void` | `printLibraryInclude(FileInclude include)` Output a library include by simple copying the contents of its associated file to the proper output location.
`protected void` | `printLicense()` Print the license terms, this is in it's own method so that it can be easily changed.
`protected void` | `printPackageDecl(Declaration decl)` Print the package declaration for the given class declaration.
`protected void` | `printStatement(Statement statement, int tabs, boolean firstTab)` Print the given statement.
`protected java.lang.String` | `toString(ClassMethod method, boolean _abstract)` Generate the declaration string for the given method.
`protected java.lang.String` | `toString(Expression exp)` Convert the given expression to a string.
`protected java.lang.String` | `toString(Field.Access access)` Mapping from access levels to java specific names.
`protected java.lang.String` | `toString(Statement_Special.Type type)` Convert the given special statement type to a the java keyword for it.
`protected java.lang.String` | `toString(Type.Default def)` Mapping from defauls to java specific values.
`protected java.lang.String` | `toString(Type type, boolean complete)` Convert the given type to it's string representation.
`protected java.lang.String` | `toString(Variable variable, boolean _abstract, boolean complete, boolean name, boolean initializer)` Convert the given variable to a string representing it's declaration.

Methods inherited from class rdlc.main.OutputFile
`delete, escapeQuotes, getCloseSpace, padToTab, printBlankLine, printTableRow, stringWidth`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### TYPE_NAMES

    public static final java.lang.String[] TYPE_NAMES

  Mapping from simple type bitwidths to names.

### OP_INFIX

    public static final java.lang.String[] OP_INFIX

  Infix operator strings. Those operations which have an empty string here are not infix operators.

Constructor Detail

### OutputFile

    public OutputFile(java.io.File outputPath,
                      java.lang.String _fileName,
                      java.lang.String _author,
                      java.lang.String _description,
                      java.util.List<java.io.File> manifest,
                      Log errorLog)

See Also:
  `OutputFile.OutputFile(File, String, String, String, List, Log)`

Method Detail

### printBlankComment

    protected void printBlankComment(int indent)

  Print a blank javadoc line at the given tabstop.

  Parameters:
    `indent` - The tabstop to print at.

### printCommentStart

    protected void printCommentStart(int indent,
                                     boolean javadoc)

  Print a javadoc start line at the given tabstop.

  Parameters:
    `indent` - The tabstop to print at.

### printCommentEnd

    protected void printCommentEnd(int indent)

  Print a javadoc end line at the given tabstop.

  Parameters:
    `indent` - The tabstop to print at.

### printCopyright

    protected void printCopyright()

  Print the copyright notice. This is in it's own method so that it can be easily be changed.

### printLicense

    protected void printLicense()

  Print the license terms, this is in it's own method so that it can be easily changed.

### printHeader

    protected void printHeader()

  Print a header for the file, including CVS changelog and tags. This will also include the copyright, license, author and description of the file.

### printLabel

    protected void printLabel(int indent,
                              java.lang.String label)

  Print a section label in a comment at the given tabstop.

  Parameters:
    `indent` - The tabstop.
    `label` - The label string.

### printCommentLine

    protected void printCommentLine(int indent,
                                    java.lang.String comment)

  Print a single line comment at the given tabstop.

  Parameters:
    `indent` - The tabstop.
    `comment` - The comment string.

### printComment

    protected void printComment(int indent,
                                java.lang.String comment)

  Print a comment at the given tabstop.

  Parameters:
    `indent` - The tabstop.
    `comment` - The comment string.

### printLabeledComment

    protected void printLabeledComment(int indent,
                                       java.lang.String label,
                                       java.lang.String comment)

  Print a labeled comment at the given tabstop.

  Parameters:
    `indent` - The tabstop.
    `label` - The label string.
    `comment` - The comment string.

### printPackageDecl

    protected void printPackageDecl(Declaration decl)

  Print the package declaration for the given class declaration.

  Parameters:
    `decl` - The RDL declaration to generate a package declaration from.

### printClassStart

    protected void printClassStart(Class _class)

  Print the javadoc comment header, inheritance list and type arguments among other things.

  Parameters:
    `_class` - The class declaration to start.

### printClassEnd

    protected void printClassEnd()

  Print the end of an class declaration.

### printClassVariable

    protected void printClassVariable(Variable variable)

  Print a class level declaration for the given variable complete with initializer and javadoc comment.

  Parameters:
    `variable` - The variable whose declaration we want to print.

### printClassMethod

    protected void printClassMethod(ClassInstance classInstance,
                                    ClassMethod classMethod)

  Print the the given method in the given class instance. This will take of javadocs, the declaration and the printing all the statements in the body.

  Parameters:
    `classInstance` - The class instance the method is in.
    `classMethod` - The method to print.

### printStatement

    protected void printStatement(Statement statement,
                                  int tabs,
                                  boolean firstTab)

  Print the given statement.

  Parameters:
    `statement` - The statment to print.
    `tabs` - The numbef of tab stops to start printing at.
    `firstTab` - Should the first line be indented at all?

### toString

    protected java.lang.String toString(Statement_Special.Type type)

  Convert the given special statement type to a the java keyword for it.

  Parameters:
    `type` - The special statement type to convert.
  Returns:
    The java keyword for that special statement type.

### toString

    protected java.lang.String toString(Variable variable,
                                        boolean _abstract,
                                        boolean complete,
                                        boolean name,
                                        boolean initializer)

  Convert the given variable to a string representing it's declaration.

  Parameters:
    `variable` - The variable to generate the declaration string for.
    `_abstract` - Is this an abstract variable?
    `complete` - Should it be a complete declaration? (includng access/protection)
    `name` - Should the name be in the output string?
    `initializer` - Should the initializer be included?
  Returns:
    Declaration string for the given variable.

### toString

    protected java.lang.String toString(ClassMethod method,
                                        boolean _abstract)

  Generate the declaration string for the given method. This will include the return type, arguments etc.

  Parameters:
    `method` - The method to generate the declaration for.
    `_abstract` - Is this method abstract?
  Returns:
    Declaration string for the given method.

### toString

    protected java.lang.String toString(Type type,
                                        boolean complete)

  Convert the given type to it's string representation.

  Parameters:
    `type` - The type to convert.
    `complete` - Should the static and final keywords be included?
  Returns:
    String representation of the given type.

### toString

    protected java.lang.String toString(Field.Access access)

  Mapping from access levels to java specific names.

  Parameters:
    `access` - The acces level to convert to a string.
  Returns:
    A java string representing that access level.

### getRealDefault

    protected Type.Default getRealDefault(Type type)

  Get the real default value for the given type. This takes bitlists longer than 64b into account.

  Parameters:
    `type` - The type to get the real default for.
  Returns:
    The java default for the given type.

### toString

    protected java.lang.String toString(Type.Default def)

  Mapping from defauls to java specific values.

  Parameters:
    `def` - The default to convert to a string.
  Returns:
    A java string representing that default.

### toString

    protected java.lang.String toString(Expression exp)

  Convert the given expression to a string.

  Parameters:
    `exp` - The expression to render to a string.
  Returns:
    String rendering of the given expression.

### listString

    protected java.lang.String listString(Expression_Operation expOp,
                                          int start)

  List the arguments of the given operation.

  Parameters:
    `expOp` - The expression whose arguments should be listed.
    `start` - The index of the first argument to list.
  Returns:
    A string representing a listing of all the arguments to this expression.

### printLibraryClass

    protected void printLibraryClass(LibraryClass xclass)

  Output a library class by simple copying the contents of its associated file to the proper output location.

  Parameters:
    `xclass` - The library class to output.

### printLibraryFile

    protected void printLibraryFile(LibraryFile file)

  Output a library file by simple copying the contents of its associated file to the proper output location.

  Parameters:
    `file` - The library file to output.

### printLibraryInclude

    protected void printLibraryInclude(FileInclude include)

  Output a library include by simple copying the contents of its associated file to the proper output location.

  Parameters:
    `include` - The library include to output.

### emit

    protected static java.util.List<java.io.File> emit(java.io.File outputPackagePath,
                                                       Declaration _declaration,
                                                       java.lang.String _author,
                                                       java.lang.String _description,
                                                       boolean shell,
                                                       boolean outputAll,
                                                       Log errorLog)

  Emit the given declaration and all of the declarations that it requires to the given path. Take into account the author and description strings given.

  Parameters:
    `outputPackagePath` - The path to which the output should go.
    `_declaration` - The declaration to output, along with it's requirements.
    `_author` - The author or username of the person running RDLC.
    `_description` - A quick description of this project.
    `errorLog` - A list of errors to be reported to the user.

### emit

    protected static java.util.List<java.io.File> emit(java.io.File outputPackagePath,
                                                       Declaration _declaration,
                                                       java.lang.String _author,
                                                       java.lang.String _description,
                                                       boolean shell,
                                                       CatalogSet<Declaration> outputSet,
                                                       boolean recurse,
                                                       boolean first,
                                                       Log errorLog)

  Emit the given declaration.

  Parameters:
    `outputPackagePath` - The path to which the output should go.
    `_declaration` - The declaration to output, along with it's requirements.
    `_author` - The author or username of the person running RDLC.
    `_description` - A quick description of this project.
    `shell` - Is this a shell unit we're generating?
    `outputSet` - The set of declarations to output as we traverse the namespace hierarchy.
    `recurse` - Should recursive folders be created for each namespace? (as opposed to putting everything in one folder).
    `first` - Is this the first call to this method as it recurses on itself?
    `errorLog` - A list of errors to be reported to the user.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD